Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@jsii/spec
Advanced tools
@jsii/spec is a package that provides TypeScript interfaces and JSON schema definitions for the jsii specification. It is used to define and validate the structure of jsii assemblies, which are used to enable interoperability between different programming languages.
TypeScript Interfaces
This feature allows you to define and work with jsii assemblies using TypeScript interfaces. The code sample demonstrates how to create a basic jsii assembly object.
import { Assembly } from '@jsii/spec';
const assembly: Assembly = {
schema: 'jsii/0.10.0',
name: 'my-package',
version: '1.0.0',
description: 'A sample jsii package',
license: 'Apache-2.0',
dependencies: {},
bundled: [],
types: {},
targets: {}
};
console.log(assembly);
JSON Schema Definitions
This feature provides JSON schema definitions for jsii assemblies, allowing you to validate the structure of your jsii assembly objects. The code sample demonstrates how to use the Ajv library to validate a jsii assembly object against the schema.
const schema = require('@jsii/spec/schema.jsii.json');
const validate = (data) => {
const Ajv = require('ajv');
const ajv = new Ajv();
const validate = ajv.compile(schema);
const valid = validate(data);
if (!valid) console.log(validate.errors);
return valid;
};
const data = {
schema: 'jsii/0.10.0',
name: 'my-package',
version: '1.0.0',
description: 'A sample jsii package',
license: 'Apache-2.0',
dependencies: {},
bundled: [],
types: {},
targets: {}
};
console.log(validate(data));
typescript-json-schema is a package that generates JSON schema from your TypeScript types. It is similar to @jsii/spec in that it deals with JSON schema and TypeScript, but it focuses on generating schema from TypeScript code rather than defining and validating jsii assemblies.
Ajv is a JSON schema validator that can be used to validate JSON data against a schema. While @jsii/spec provides specific schema definitions for jsii assemblies, Ajv is a more general-purpose tool for JSON schema validation.
json-schema is a package that provides a collection of JSON schema validation tools. It is similar to @jsii/spec in that it deals with JSON schema validation, but it is a more general-purpose library not specifically tailored to jsii assemblies.
Defines the JSON specification for .jsii metadata files, part of the jsii project.
jsii is distributed under the Apache License, Version 2.0.
FAQs
Specification for jsii assemblies
The npm package @jsii/spec receives a total of 131,569 weekly downloads. As such, @jsii/spec popularity was classified as popular.
We found that @jsii/spec demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.